import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

export default defineNuxtPlugin((nuxtApp) => {
    // 使用 Element Plus
    nuxtApp.vueApp.use(ElementPlus)

    // 注册所有图标
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
        nuxtApp.vueApp.component(key, component)
    }

    // 也可以提供全局访问
    nuxtApp.provide('elementIcons', ElementPlusIconsVue)
})
